<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Internationalization</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="libiptcdata Reference Manual">
<link rel="up" href="index.html" title="libiptcdata Reference Manual">
<link rel="prev" href="iptc-libjpeg.html" title="libjpeg Interoperability">
<link rel="next" href="ch01.html" title="IPTC Data Manipulation">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="IPTC Data Manipulation">
<link rel="chapter" href="ch02.html" title="Format-specific Functions">
<link rel="chapter" href="ch03.html" title="Helper Functions">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="iptc-libjpeg.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td> </td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libiptcdata Reference Manual</th>
<td><a accesskey="n" href="ch01.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry" lang="en">
<a name="iptc-i18n"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Internationalization</span></h2>
<p>Internationalization — using extended character sets with a libiptcdata application</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" lang="en">
<a name="i18n"></a><h2>Supporting Internationalization with libiptcdata</h2>
<p>
	 The IPTC IIM standard supports storing data with nearly any
	 character set.  According to the standard, the data of
	 Record 1 should be in plain ASCII, but data of the following
	 records should follow the character set established by
	 dataset 1:90, the "character set" dataset.  This dataset
	 contains control functions according to the ISO 2022
	 standard, which allow for switching between different
	 character sets.  However, there are several problems with this
	 approach:
	 </p>
<div class="itemizedlist"><ul type="disc">
<li><p>
	     Nearly all IPTC-aware applications written previously do not
	     follow this standard.  They usually force all characters to
	     ASCII or use the Latin-1 character set, without identifying
	     it in dataset 1:90.
	   </p></li>
<li><p>
	     The ISO 2022 standard is very complicated and lacks a free
	     reference implementation.  In addition, the standard
	     is rarely used since Unicode provides a superior
	     alternative.
	   </p></li>
</ul></div>
<p>
	</p>
<p>
	 libiptcdata does not implement the complete ISO 2022 standard (in
	 fact, it implements almost none of it), but can still be used
	 successfully with multiple character sets.  Here's how:
	 </p>
<div class="orderedlist"><ol type="1">
<li><p>
	     When IPTC data is added to an image file for the first time,
	     always store data in the UTF-8 character set.  It is the
	     responsibility of the application to make sure that the
	     <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-data" title="iptc_dataset_set_data ()"><code class="function">iptc_dataset_set_data()</code></a>
	     function is always called with UTF-8
	     encoded data.  This generally happens automatically with
	     modern toolkits such as gtk+.  The application should call
	     <a class="link" href="libiptcdata-data.html#iptc-data-set-encoding-utf8" title="iptc_data_set_encoding_utf8 ()"><code class="function">iptc_data_set_encoding_utf8()</code></a>
	     which sets the value of dataset 1:90, indicating that UTF-8 is
	     being used.
	   </p></li>
<li><p>
	     When reading or modifying IPTC data saved by another application,
	     first use the
	     <a class="link" href="libiptcdata-data.html#iptc-data-get-encoding" title="iptc_data_get_encoding ()"><code class="function">iptc_data_get_encoding()</code></a>
	     function to find out what encoding the data has been stored in.
	     If it's not UTF-8, it may be hard to identify the character set,
	     since the ISO 2022 standard is generally not followed.  Often,
	     a good guess is ISO-8859-1.  However, if new data is added, it is
	     probably wise to start using the UTF-8 encoding.
	   </p></li>
</ol></div>
<p>
	</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.10</div>
</body>
</html>
